{template 'common/header'}
<div class="main">
<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo $this->createWebUrl('list');}">题库列表</a></li>
	<li><a href="{php echo $this->createWebUrl('add');}">添加题目</a></li>
</ul>
	<div class="panel panel-info">
		<div class="panel-heading">筛选</div>
		<div class="panel-body">
			<form action="./index.php" method="post" class="form-horizontal" role="form">
			<input type="hidden" name="c" value="site">
			<input type="hidden" name="a" value="entry">
			<input type="hidden" name="do" value="List">
			<input type="hidden" name="m" value="hx_dialect" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>
				<div class="col-sm-4">
					<input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}">
				</div>
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">分值</label>
				<div class="col-sm-4">
					<input class="form-control" name="mark" id="" type="text" value="{$_GPC['mark']}">
				</div>				
			</div>
			<div class="form_group">
				<input name="token" type="hidden" value="{$_W['token']}" />
				<input type="submit" class="btn btn-primary" name="submit" value="提交" />
			</div>
			</form>
		</div>
	</div>
	
	<div style="padding:15px;">
		<form action="" method="post">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th style="width:5px;" class="row-first">选择</th>
					<th align="center" style="width:20px;text-align:center;">ID</th>						
                    <th align="center" style="width:100px;text-align:center;">题目标题</th>
					<th align="center" style="width:40px;text-align:center;">选项</th>
					<th align="center" style="width:80px;text-align:center;">答案</th>
					<th align="center" style="width:60px;text-align:center;">分值</th>
					<th align="center" style="width:40px;text-align:center;">备注</th>
					<th style="width:80px;text-align:center;">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $row}
					<tr>
						<td class="row-first"><input type="checkbox" name="select[]" value="{$row['id']}" /></td>				
						<td align="center" style="text-align:center;">{$row['id']}</td>
                        <td align="center" style="text-align:center;{if $row['status'] == '0'}color:red;{/if}">{$row['title']}</td>
						<td align="center" style="font-size:12px; color:#666text-align:center;">{$row['type']}</td>
						<td align="center" style="font-size:12px; color:#666; text-align:center;">{$row['answer']}</td>
						<td align="center" style="font-size:12px; color:#666; text-align:center;">{$row['mark']}</td>
						<td align="center" style="font-size:12px; color:#666; text-align:center;">{if $row['remark']}{$row['remark']}{else}暂无备注{/if}</td>
						<td style="text-align:center;">
                        	<a href="{php echo $this->createWebUrl('Add',array('id'=>$row['id']));}">编辑</a> | {if $row['status'] == '0'}<a href="{php echo $this->createWebUrl('UnFrozen',array('id'=>$row['id']));}">启用</a>{else}<a href="{php echo $this->createWebUrl('Frozen',array('id'=>$row['id']));}">禁用</a>{/if} | <a href="{php echo $this->createWebUrl('Delete',array('id'=>$row['id']));}" onclick="return confirm('删除记录后不可恢复,确定要删除吗?')" >删除</a>
                        </td>
					</tr>
				{/loop}
					<tr>
						<td><input type="checkbox" id="checkall" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});"></td>
						<td colspan="7">
							<input name="Deleteall" class="btn btn-primary" value="删除选中" type="submit"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input name="Frozenall" class="btn btn-primary" value="禁用选中" type="submit"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
						</td>
					</tr>
			</tbody>
		</table>
	</form>
		{$pager}
	</div>
</div>
{template 'common/footer'}